package com.hjr.calculator.algorithm;

import com.hjr.calculator.CalcStrategy;

import java.math.BigDecimal;

import static com.hjr.calculator.CalcConstant.KEEP_SCALE;
import static com.hjr.calculator.CalcConstant.ROUNDING_MODE;

public class SubtractAlgorithm implements CalcStrategy {

    @Override
    public BigDecimal calc(BigDecimal num1, BigDecimal num2) {
        return num1.subtract(num2).setScale(KEEP_SCALE, ROUNDING_MODE);
    }
}